package org.lagou.edu.serialization.dto;

import lombok.Data;

import java.util.Map;

@Data
public class OperationInfo {

    /**
     * binlog position
     */
    private String id;

    /**
     * 库名称
     */
    private String database;
    /**
     * 表名称
     */
    private String table;
    /**
     * 业务主键ID
     */
    private String pkId;
    /**
     * 操作类型
     */
    private String type;
    /**
     * 老值
     */
    private Map<String, String> oldValue;
    /**
     * 新值
     */
    private Map<String, String> newValue;
    /**
     * binlog 执行时间
     */
    private Long es; // binlog executeTime
    /**
     * dml 构建时间
     */
    private Long ts; // dml build timeStamp

    public OperationInfo() {
    }

    public OperationInfo(String database, String table, String pkId, String type, Map<String, String> newValue, Long es, Long ts) {
        this.database = database;
        this.table = table;
        this.pkId = pkId;
        this.type = type;
        this.newValue = newValue;
        this.es = es;
        this.ts = ts;
    }
}
